<template>
  <div>
    <topper></topper>
    <good-header></good-header>
    <good-nav></good-nav>
    <good-wrapper :detail="details"></good-wrapper>
  </div>
</template>
<script>
import '../../assets/statics/css/goods-detail.css'
import Topper from '../../components/Topper'
import GoodHeader from './components/GoodHeader'
import GoodNav from './components/GoodNav'
import GoodWrapper from './components/GoodWrapper'
import http from '../../base/api/http'
export default {
  name: 'SearchDetail',
  components: {
    GoodWrapper,
    GoodNav,
    GoodHeader,
    Topper
  },
  data () {
    return {
      details: {
        commodityId: null,
        commodityImgurl: null,
        commodityName: null,
        commodityPrice: null,
        commodityNum: null,
        commodityIntroduce: null,
        brandId: null,
        categoryId: null
      }
    }
  },
  methods: {
    find () {
      var id = this.$route.query.commodityId
      console.log(id)
      http.requestGet('/java/api/commodity/getCommodityDetails', {
        'commodityId': id
      }).then((res) => {
        if (res.status === 0) {
          this.details = res.data
          console.log(this.details)
        }
      })
    }
  },
  mounted () {
    this.find()
  }
}
</script>
<style>
</style>
